from retrying import retry

def retry_error(exception):
    return isinstance(exception,NameError)
#
def func1(x):
    if not x>5:
        return True
    else:
        return False
class aa:
    i=0
    @retry(retry_on_result=retry_error)#retry_on_exception=retry_error,
    def show(self):
        print("重置")
        self.i=self.i+1
        if self.i>5:
            print("a")
            retry_error(print("a"))
        else:
            print(a)
            retry_error(print(a))
        

        
        print(self.i)

    def run(self):
        self.show()
if __name__=="__main__":
    print(aa().run())
